package com.tom.architect.day19.simple3;

import com.tom.architect.day19.simple3.facade.UserSystemFacade;
import com.tom.architect.day19.simple3.handler.UserInfo;

/**
 * 迭代器模式的应用：
 *
 */
public class Client {
    public static void main(String[] args) {
        // 根据用户名+密码去查询用户信息，
        // 查询到了代表登录成功，查询不到代表登录失败。
/*        WXUserSystem wxUserSystem = new WXUserSystem();
        QQUserSystem qqUserSystem = new QQUserSystem();
        NYUserSystem nyUserSystem = new NYUserSystem();
        // 责任链。
        wxUserSystem.nextHandler(qqUserSystem);
        qqUserSystem.nextHandler(nyUserSystem);

        UserInfo userInfo = wxUserSystem.queryUserInfo("cc", "125");
        System.out.println(userInfo);*/

        UserSystemFacade userSystemFacade = new UserSystemFacade();
        UserInfo userInfo = userSystemFacade.queryUserInfo("cfc", "125");
        System.out.println(userInfo);
    }

}
